<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>Rainy Day – 逼真的雨滴效果</title>
    <style media="screen">
    body {
        overflow: hidden;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    img {
        width: 100%;
        height: 100%;
    }
    </style>
</head>

<body onload="run();">
    <img src="./img/img_bg_main.jpg" id="bg-img" />
    <script src="./js/rainyday.js"></script>
    <script>
        function run() {
            var image = document.getElementById('bg-img');
            image.onload = function() {
                var engine = new RainyDay({
                    image: this
                });
                engine.rain([
                    [3, 2, 2]
                ], 100);
            };
            image.crossOrigin = 'anonymous';
        }
    </script>
</body>

</html>